/**
 * Copyright (C) 2018-2019
 * All rights reserved, Designed By www.joolun.com
 * 注意：
 * 本软件为www.joolun.com开发研制，项目使用请保留此说明
 */
package com.joolun.web.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.joolun.common.core.domain.AjaxResult;
import com.joolun.mall.entity.Advertisement;
import com.joolun.mall.service.IAdvertisementService;
import com.joolun.system.domain.SysNotice;
import com.joolun.system.service.ISysNoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商品api
 *
 * @author JL
 * @date 2019-08-12 16:25:10
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/weixin/api/ma/advertisement")
@Api(value = "advertisement", tags = "广告设置")
public class AdvertisementApi {

    private final IAdvertisementService advertisementService;

    private final ISysNoticeService sysNoticeService;

	/**
	 * 查询幻灯片
	 * @param advertisement
	 * @return
	 */
	@ApiOperation(value = "查询广告幻灯片")
	@GetMapping("/list")
	public AjaxResult list(Advertisement advertisement) {
		return AjaxResult.success(advertisementService.list(new QueryWrapper<Advertisement>(advertisement)));
	}


	/**
	 * 查询幻灯片
	 * @param sysNotice
	 * @return
	 */
	@ApiOperation(value = "查询通知公告")
	@GetMapping("/notice/list")
	public AjaxResult list(SysNotice sysNotice) {
		return AjaxResult.success(sysNoticeService.selectNoticeList(sysNotice));
	}

}
